﻿#include <chrono>
#include <iostream>
#include <string>
#include <thread>
#include <zmq.hpp>
#include <zmq_addon.hpp>

using namespace std;

int main() {
  // initialize the zmq context with a single IO thread
  zmq::context_t context{1};

  // 绑定 sub
  zmq::socket_t subFront{context, zmq::socket_type::xsub};
  subFront.bind("tcp://127.0.0.1:9527");

  // 绑定 pub
  zmq::socket_t pubBack{context, zmq::socket_type::xpub};
  pubBack.bind("tcp://127.0.0.1:9528");

  proxy(subFront, pubBack);
}
